package com.yunshan.mp;

import com.yunshan.common.core.controller.BaseController;
import com.yunshan.common.core.domain.AjaxResult;
import com.yunshan.mp.service.IMpServeBannerService;
import com.yunshan.mp.service.IMpServeInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
 * 服务列表查询
 *
 * @author yunshan
 * @date 2025-02-13
 */
@Api(tags = "服务列表查询")
@RestController
@RequestMapping("/api/serve")
public class MpServeController  extends BaseController
{

    @Autowired
    private IMpServeBannerService mpServeBannerService;
    @Autowired
    private IMpServeInfoService mpServeInfoService;

    /**
     * 服务首页banner
     */
    @ApiOperation("服务首页banner")
    @GetMapping("/banner")
    public AjaxResult banner(@RequestParam String serveType)
    {
        return success(mpServeBannerService.selectUniBanner(serveType));
    }

    /**
     * 服务列表
     */
    @ApiOperation("查询服务列表")
    @GetMapping("/serve")
    public AjaxResult serve(
            @ApiParam(name = "serveType", value = "服务类型", required = true)
            @RequestParam String serveType)
    {
        return success(mpServeInfoService.selectUniServeList(serveType));
    }

    /**
     * 查询服务详情
     */
    @ApiOperation("查询服务详情")
    @GetMapping("/info")
    public AjaxResult getInfo(
            @ApiParam(name = "id", value = "服务id", required = true)
            @RequestParam Long id)
    {
        return success(mpServeInfoService.selectMpServeInfoById(id));
    }

}
